package senior.DateExer;

import java.util.Calendar;

/**
 * 学士后月考是每月的第一个周六，输出今年的月考时间
 *
 * @author shkstart
 * @creat 2022-04-22:32
 */
public class Exer7 {
    public static void main(String[] args) {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, 2022);
        int month = cal.getActualMaximum(Calendar.MONTH);
        int day = cal.getActualMaximum(Calendar.DATE);
        for (int i = 0;i <= month;i++){
            cal.set(Calendar.MONTH,i);
            for (int j = 1;j <= day;j++){
                cal.set(Calendar.DATE,j);
                if(cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY && cal.get(Calendar.DAY_OF_WEEK_IN_MONTH) == 1){
                    System.out.println(cal.getTime());
                }
            }
        }
    }
}
